<template>
  <div>
    <my-header-2></my-header-2><my-header-1></my-header-1>
    <div class="short-video-list">
      <a href="" v-for="item in short_video_list" :key="item.id">
        <div
          class="short-video-item"
          :style="{ 'background-image': 'url(' + item.images[0].url + ')' }"
        >
          <div class="title">{{ item.title }}</div>
          <div class="video-info">
            <div class="video-info-left">
              <img :src="item.user.avatarurl" alt="" />
              <div class="user-nickname">{{ item.user.nickName }}</div>
            </div>
            <div class="video-info-right">
              <span class="iconfont icon-dianzan"></span
              ><span>{{ item.upCount }}</span>
            </div>
          </div>
        </div>
      </a>
    </div>
  </div>
</template>


<script>
import MyHeader1 from "../components/MyHeader1.vue";
import MyHeader2 from "../components/MyHeader2.vue";
import axios from "axios";
export default {
  // eslint-disable-next-line vue/multi-word-component-names
  name: "Movie",
  components: {
    MyHeader1,
    MyHeader2,
  },
  data() {
    return {
      short_video_list: [],
      images_url: '',
      end_url:''
    };
  },
  mounted() {
    axios.get("./json/shortvideo.json").then((res) => {
      console.log(res);
      // eslint-disable-next-line vue/no-mutating-props
      this.short_video_list = res.data.data.feeds;
    });
  },
};
</script>

<style scoped lang="less">
.short-video-list {
  width: 100%;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  padding-bottom: 50px;
  a {
    .short-video-item {
      width: 186px;
      height: 300px;
      background-size: cover;
      display: inline-block;
      cursor: pointer;
      margin: 0 0.5% 2px 0;
      position: relative;
      
      .title {
        width: 165px;
        margin: 0 8px;
        position: absolute;
        color: #fff;
        font-size: 16px;
        line-height: 24px;
        bottom: 40px;
        text-shadow: 0 0 3px rgb(0 0 0 / 30%);
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        overflow: hidden;
        left: 3px;
      white-space: wrap;
        text-overflow: ellipsis;
      overflow: hidden;
      }
      .video-info {
        display: flex;
        align-items: center;
        position: absolute;
        left: 10px;
        bottom: 14px;
        color:#fff;
        justify-content: space-between;

        .video-info-left {
          display: flex;
          width: 130px;
          img {
            height: 22px;
            width: 22px;
            border-radius: 50%;
          }
        }
        .video-info-right {
          display: flex;
        }
      }
    }
  }
}
</style>

